{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pointCollection as pc\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import re\n",
    "import glob\n",
    "import h5py\n",
    "import scipy.ndimage as snd\n",
    "%load_ext autoreload\n",
    "%autoreload 2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "%matplotlib widget"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "def smooth_misfit(D, w, field='z', kernel_type='gauss'):\n",
    "    dx=np.diff(D.x[0:2])\n",
    "    if kernel_type=='gauss':\n",
    "        xk=np.arange(-3*w, 3*w+dx, dx)\n",
    "        K=np.exp(-xk**2/2/w**2)\n",
    "    else:\n",
    "        K=np.ones(int(w/dx))\n",
    "    K /= np.sum(K)\n",
    "    temp=np.squeeze(getattr(D, field)**2)\n",
    "    temp[~np.isfinite(temp)]=0\n",
    "    temp1=np.isfinite(np.squeeze(getattr(D, field))).astype(float)\n",
    "    sR=snd.convolve( snd.convolve(temp, K[:, np.newaxis], mode='constant'), K[:, np.newaxis].T, mode='constant')\n",
    "    temp1 = snd.convolve( snd.convolve(temp1, K[:, np.newaxis], mode='constant'), K[:, np.newaxis].T, mode='constant')\n",
    "    sR[temp1 > 0] /= temp1[temp1>0]\n",
    "    return np.sqrt(sR)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [],
   "source": [
    "#maps={}\n",
    "base='/home/besmith4/nobackup/ATL14_test/'\n",
    "#for sub in ['base_dz0.3x', 'base', 'base_dz3x']:\n",
    "for sub in [ 'base', 'base_dtt3x', 'base_dtt10x']:\n",
    "    run_dir=base+sub\n",
    "    maps[sub]={}\n",
    "    maps[sub]['z0']=pc.grid.data().from_h5(run_dir+'/z0.h5', group='z0')\n",
    "    maps[sub]['dz']=pc.grid.data().from_h5(run_dir+'/dz.h5', group='dz')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<class 'pointCollection.grid.data.data'> with shape (321, 321, 6),\n",
       "with fields:\n",
       "['count', 'dz', 'misfit_rms', 'misfit_scaled_rms', 'sigma_dz']"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "maps[sub]['dz']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "49f501d4918b48ed91ff7973e3457f53",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.figure( figsize=[8, 6]); \n",
    "#for count, sub in enumerate(['base_dz0.3x', 'base', 'base_dz3x']):\n",
    "for count, sub in enumerate([ 'base', 'base_dtt3x', 'base_dtt10x']):\n",
    "    plt.subplot(3,4,4*count+1)\n",
    "    plt.imshow(np.gradient(maps[sub]['z0'].z0[:,:,0])[0], extent=maps[sub]['z0'].extent, vmin=-3, vmax=3,  origin='lower',cmap='gray')\n",
    "    plt.subplot(3,4,4*count+2)\n",
    "    plt.imshow(maps[sub]['dz'].dz[:,:,4]- maps[sub]['dz'].dz[:,:,0], extent=maps[sub]['dz'].extent, vmin=-3, vmax=3,  origin='lower',cmap='Spectral')\n",
    "    plt.subplot(3,4,4*count+3)\n",
    "    plt.imshow(maps[sub]['dz'].sigma_dz[:,:,4], extent=maps[sub]['dz'].extent, clim=[0, 0.05], origin='lower', cmap='magma')    \n",
    "    plt.subplot(3,4,4*count+4)\n",
    "    if not hasattr(maps[sub]['z0'],'misfit_rms_s'):\n",
    "        maps[sub]['z0'].assign({'misfit_rms_s':smooth_misfit(maps[sub]['z0'], 1000, kernel_type='boxcar', field='misfit_scaled_rms')})\n",
    "    plt.imshow(maps[sub]['z0'].misfit_rms_s, extent=maps[sub]['z0'].extent, vmin=0, vmax=4,  origin='lower')\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "base_dz0.3x 1.743782681865746\n",
      "base 1.384354851032408\n",
      "base_dz3x 1.1532535617466944\n"
     ]
    }
   ],
   "source": [
    "for ii, sub in enumerate(maps.keys()):\n",
    "    print(f\"{sub} {np.nanmedian(maps[sub]['misfit_rms'].zs.ravel())}\")\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.figure(); plt.imshow(sR, origin='lower', extent=maps[sub]['misfit_rms'].extent, clim=[0,2]); plt.colorbar()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "E=pc.grid.data().from_h5('/home/besmith4/nobackup/ATL14_test//base/dz_sigma.h5', group='/dz/sigma' )\n",
    "E_z0=pc.grid.data().from_h5('/home/besmith4/nobackup/ATL14_test//base/z0_sigma.h5', group='/z0/sigma', field_mapping={'z0':'z0'} )"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.imshow(E.dz[:,:,1], origin='lower', extent=E.extent, clim=[0, 0.07])\n",
    "plt.colorbar(label='error for 2019.5')\n",
    "plt.plot(E.x, np.ones_like(E.x)*E.y[20],'w')\n",
    "plt.figure(); \n",
    "for ii in range(E.dz.shape[2]-1):\n",
    "    plt.plot(E.x, E.dz[20,:, ii], label=f't={E.t[ii]}')\n",
    "\n",
    "plt.legend()\n",
    "plt.gca().set_xlabel('x, m')\n",
    "plt.gca().set_ylabel('dz error, m')\n",
    "plt.gca().set_ylim([0, 0.25])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "\n",
    "fig, ax=plt.subplots(4,6, constrained_layout=True, figsize=[18,12])\n",
    "for ii in range(6):\n",
    "    hi_dz=ax[0,ii].imshow(E.dz[:,:,ii], origin='lower', extent=E.extent, vmin=0, vmax=0.05); #plt.colorbar(label='$\\sigma_{dz}$')\n",
    "    ax[0,ii].set_title('%2.2f' % E.t[ii])\n",
    "    if ii+1 < E.t.size:\n",
    "        hi_dz1=ax[1, ii].imshow(E.dzdt_lag1[:,:,ii], origin='lower', extent=E.extent, vmin=0, vmax=0.2); #plt.colorbar(label='$\\sigma_{dz/dt}$ lag 1')\n",
    "        ax[1, ii].set_title('%2.2f to %2.2f' %( E.t[ii], E.t[ii+1]))\n",
    "    else:\n",
    "        ax[1,ii].set_visible(False)\n",
    "    if ii+4 < E.t.size:\n",
    "        hi_dz4=ax[2, ii].imshow(E.dzdt_lag4[:,:,ii], origin='lower', extent=E.extent, vmin=0, vmax=0.2); #plt.colorbar(label='$\\sigma_{dz/dt}$ lag 4')\n",
    "        ax[2, ii].set_title('%2.2f to %2.2f' %( E.t[ii], E.t[ii+4]))\n",
    "    else:\n",
    "        ax[2,ii].set_visible(False)\n",
    "    if ii > 0:\n",
    "        ax[3,ii].set_visible(False)\n",
    "hi_z0=ax[3,0].imshow(E_z0.z0[:,:,0], origin='lower', extent=E_z0.extent, vmin=0, vmax=1)\n",
    "ax[3, 0].set_title('$z_0$ (2020)')\n",
    "\n",
    "#plt.tight_layout()\n",
    "fig.colorbar(hi_dz, ax=ax[0, :], location='right', shrink=0.6, label='dz')\n",
    "fig.colorbar(hi_dz1, ax=ax[1,0:-1], location='right', shrink=0.6, label='dz/dt, lag 1')\n",
    "fig.colorbar(hi_dz4, ax=ax[2,0:2], location='right', shrink=0.6, label='dz/dt, lag 4')\n",
    "fig.colorbar(hi_z0, ax=[ax[3,0]], location='right', shrink=0.6, label='z0')\n",
    "\n",
    "fig2=plt.figure()\n",
    "#plt.tight_layout() "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#print(maps['base']['dz'].t)\n",
    "plt.figure(); \n",
    "plt.plot(E.t, np.squeeze(E.dz[35, 40, :]), label='dz')\n",
    "plt.plot(E.t+0.125, np.squeeze(E.dzdt_lag1[35, 40, :]), label='dzdt_lag1')\n",
    "plt.plot(E.t+0.5, np.squeeze(E.dzdt_lag4[35, 40, :]), label='dzdt_lag4')\n",
    "z0_error2=np.squeeze(E.dz[35, 40, :])**2\n",
    "z0_error2[:-1] += z0_error2[1:]\n",
    "z0_error2[-1] = np.NaN\n",
    "plt.plot(E.t+0.125, np.sqrt(z0_error2)*4, label='4* rss dz error')\n",
    "plt.legend()\n",
    "plt.xlabel('year')\n",
    "plt.ylabel('error est, m/yr')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "plt.imshow(E_z0.z0[:,:,0], origin='lower', extent=E_z0.extent, vmin=0, vmax=1)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "clim=2*np.array([-1, 1])\n",
    "n_cols=np.ceil(np.sqrt(dz.shape[2]-2)).astype(int)\n",
    "n_rows=np.ceil((dz.shape[2]-2)/n_cols).astype(int)+1\n",
    "fig=plt.figure(2, figsize=[6, 8]); plt.clf()\n",
    "h_im=[]\n",
    "#h_ax=[]\n",
    "fig, h_ax = plt.subplots(n_rows, n_cols, num=2)\n",
    "for tslice in range(dz.shape[2]-2):\n",
    "    axn=np.unravel_index(tslice, h_ax.shape)\n",
    "    ax=h_ax[axn]\n",
    "    #h_ax.append(fig.add_subplot(n_rows, n_cols, tslice+1))\n",
    "    h_im.append(ax.imshow(dz.z[:,:,tslice+1]-dz.z[:,:,tslice], extent=dz.extent, origin='lower', cmap='Spectral', clim=clim))\n",
    "    ax.set_title('%2.2f to %2.2f'% (dz.t[tslice], dz.t[tslice+1]))\n",
    "\n",
    "axn=np.unravel_index(tslice+1, h_ax.shape)\n",
    "ax=h_ax[axn]\n",
    "h_im.append(ax.imshow(dz.z[:,:,tslice+1]-dz.z[:,:,0], extent=dz.extent, origin='lower', cmap='Spectral', clim=clim))\n",
    "ax.set_title('%2.2f to %2.2f'% (dz.t[0], dz.t[tslice+1]))    \n",
    "\n",
    "fig.tight_layout()\n",
    "plt.colorbar(h_im[0], ax=h_ax)\n",
    "h_ax[-1, -1].set_visible(False)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "(z0.y[-1]-z0.y[0])/np.diff(z0.y[0:2])\n",
    "z0.shape\n",
    "thefile=glob.glob(run_dir+'/*/E-160*.h5')\n",
    "print(thefile)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "thefile=glob.glob(run_dir+'/*/E-160_N-1800.h5')[0]\n",
    "print(thefile)\n",
    "temp=pc.grid.data().from_h5(thefile, group='dz', field_mapping={'z':'dz','count':'count'})\n",
    "plt.figure();\n",
    "plt.imshow(temp.z[:,:,3]-temp.z[:,:,0], origin='lower', extent=dz.extent); plt.colorbar()\n",
    "N=pc.grid.data().from_h5(thefile, group='dz', field_mapping={'z':'count'})\n",
    "plt.figure();\n",
    "#plt.imshow(np.sum(N.z>0, axis=2))\n",
    "plt.imshow(N.z[:,:,-2], extent=N.extent, origin='lower')\n",
    "plt.colorbar()\n",
    "\n",
    "\n",
    "#plt.imshow(np.nansum(temp.z>0, axis=2), origin='lower', extent=dz.extent); plt.colorbar()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "temp.t"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "temp0=pc.grid.data().from_h5(thefile, group='z0', field_mapping={'z':'z0'})\n",
    "print(temp0)\n",
    "print(temp0.x[-1]-temp0.x[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ctr_dir='/Volumes/ice2/ben/ATL14_test/IS2//U07/z03xlooser_dt10xlooser_40km/centers'\n",
    "edge_dir='/Volumes/ice2/ben/ATL14_test/IS2//U07/z03xlooser_dt10xlooser_40km/edges'\n",
    "\n",
    "c_files=['E-160_N-1800.h5',  'E-120_N-1800.h5']\n",
    "fig=plt.figure(4)\n",
    "fig.clf()\n",
    "Dc={}\n",
    "Bc={}\n",
    "for file in c_files:\n",
    "    Dc[file]=pc.grid.data().from_h5(ctr_dir+'/'+file, group='dz', field_mapping={'z':'dz'})\n",
    "    with h5py.File(ctr_dir+'/'+file,'r') as h5f:\n",
    "        Bc[file]={'rgt':np.array(h5f['/bias/rgt']),\n",
    "           'cycle':np.array(h5f['/bias/cycle']),\n",
    "           'val':np.array(h5f['/bias/val'])}\n",
    "De={}\n",
    "Be={}\n",
    "for file in ['E-140_N-1800.h5']:\n",
    "    De[file]=pc.grid.data().from_h5(edge_dir+'/'+file, group='dz', field_mapping={'z':'dz'})    \n",
    "    with h5py.File(ctr_dir+'/'+file,'r') as h5f:\n",
    "        Be[file]={'rgt':np.array(h5f['/bias/rgt']),\n",
    "           'cycle':np.array(h5f['/bias/cycle']),\n",
    "           'val':np.array(h5f['/bias/val'])}\n",
    "    \n",
    "for file in files:\n",
    "    plt.plot(Dc[file].x, Dc[file].z[int(np.ceil(Dc[file].shape[0]/2)),:,2])\n",
    "\n",
    "for file in ['E-140_N-1800.h5']:\n",
    "    plt.plot(De[file].x, De[file].z[int(np.ceil(De[file].shape[0]/2)),:,2], '--')\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "fig=plt.figure(5)\n",
    "fig.clf()\n",
    "Dc0={}\n",
    "for file in files:\n",
    "    Dc0[file]=pc.grid.data().from_h5(ctr_dir+'/'+file, group='z0', field_mapping={'z':'z0'})\n",
    "    \n",
    "De0={}\n",
    "for file in ['E-140_N-1800.h5']:\n",
    "    De0[file]=pc.grid.data().from_h5(edge_dir+'/'+file, group='z0', field_mapping={'z':'z0'})    \n",
    "  \n",
    "for file in files:\n",
    "    plt.plot(Dc0[file].x, Dc0[file].z[int(np.ceil(Dc0[file].shape[0]/2)),:])\n",
    "\n",
    "for file in ['E-140_N-1800.h5']:\n",
    "    plt.plot(De0[file].x, De0[file].z[int(np.ceil(De0[file].shape[0]/2)),:], '--')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "len(rgts)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "rc, ic, ie=np.intersect1d(Bc[files[2]]['rgt']+1j*Bc[files[2]]['cycle'], \\\n",
    "                          Be[files[1]]['rgt']+1j*Be[files[1]]['cycle'], return_indices=True)\n",
    "fig=plt.figure(6); plt.clf()\n",
    "plt.hist(Bc[files[2]]['val'][ic]-Be[files[1]]['val'][ie])\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "total 730752\n",
      "-rw-rw-r-- 1 besmith4 j1008 707264965 Aug 25 17:35 E0_N240.h5\n",
      "-rw-rw-r-- 1 besmith4 j1008  40815240 Aug 18 23:50 E-720_N-480.h5\n"
     ]
    }
   ],
   "source": [
    "! ls -lt ~/temp/centers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "total 134304\n",
      "-rw-rw-r-- 1 besmith4 j1008 137309295 Aug 25 18:18 E0_N240.h5\n"
     ]
    }
   ],
   "source": [
    "! ls -lt ~/temp/decimated/centers"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [],
   "source": [
    "dzf=pc.grid.data().from_h5('/home/besmith4/temp/centers/E0_N240.h5', group='dz')\n",
    "dzd=pc.grid.data().from_h5('/home/besmith4/temp/decimated/centers/E0_N240.h5', group='dz')\n",
    "z0f=pc.grid.data().from_h5('/home/besmith4/temp/centers/E0_N240.h5', group='z0')\n",
    "z0d=pc.grid.data().from_h5('/home/besmith4/temp/decimated/centers/E0_N240.h5', group='z0')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "0c6f8461bb9841b2be53c8c193e9f43b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "72a4ffeaa3ba4fcaafcd14ffd5bbd96d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "for this_dz in [dzf, dzd]:\n",
    "    fig=plt.figure();\n",
    "    for i in np.arange(4)+1:\n",
    "        fig.add_subplot(2,2, i)\n",
    "        plt.imshow(this_dz.dz[:,:,i]-this_dz.dz[:,:,i-1], clim=[-0.1, 0.1], cmap='Spectral', origin='lower'); \n",
    "        plt.title(f'{this_dz.t[i-1]} to {this_dz.t[i]}')\n",
    "plt.tight_layout()\n",
    "#plt.figure();\n",
    "#plt.imshow(dzd.dz[:,:,i]-dzf.dz[:,:,i-1], clim=[-0.1, 0.1], cmap='Spectral')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "05fb01165eb2493dbacd6083b792ad7d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.image.AxesImage at 0x7fd65c8c5650>"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plt.figure();\n",
    "plt.imshow(np.gradient(z0d.z0)[1], cmap='gray', origin='lower')\n",
    "#plt.figure();\n",
    "#plt.imshow(np.gradient(z0d.z0)[0], cmap='gray')\n",
    "         "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "b2ac92272e7b4c2b89682d9cd0926506",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "<matplotlib.colorbar.Colorbar at 0x7fd661669e90>"
      ]
     },
     "execution_count": 45,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plt.figure();\n",
    "plt.imshow(z0d.z0-z0f.z0, clim=[-.2, 0.2]); plt.colorbar()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "1d45bc0b834a47a68c7ae006bbf166ee",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Canvas(toolbar=Toolbar(toolitems=[('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous …"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/plain": [
       "[<matplotlib.lines.Line2D at 0x7fd65c5ea150>]"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "plt.figure(); plt.plot(z0d.z0[200,:])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "IS2",
   "language": "python",
   "name": "is2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
